home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2005 March
/
Gamestar_71_2005-03_dvd.iso
/
Dema
/
willofsteel_demo.exe
/
{app}
/
Data
/
Shaders
/
Terrain00.fx
< prev
next >
Wrap
Text File
|
2004-10-23
|
4KB
|
145 lines
float4x4 WorldViewProjection;
float4x4 ShadowViewProjection;
float4x4 TextureMatrix;
texture AlphaTexture;
texture DiffuseTexture;
texture ShadowTexture;
texture CloudsTexture;
texture FogOfWar;
float3 LightDirection = { 0.0f, 0.0f, 0.0f };
float3 SunColor = { 1., 0.86, .70 };//, 1.0 };
float3 Ambient = { 0.24, 0.12, 0.04 };//, 1.0 };
float4 FogScale = { 0.001953125, 0.001953125, 0.001953125, 0.001953125 };
float4 ZBias = { 0.0, 0.0, 0.0, 0.003 };
float4 ShadowOffset;
float4 CloudUVShift = { 0.0, 0.0, 0.0, 0.0 };
float4 CloudScale = { 0.01, 0.01, 0.01, 0.01 };
technique Technique0
{
pass Pass0
{
Texture[0] = (DiffuseTexture);
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
ColorArg2[0] = DIFFUSE;
ColorOp[1] = MODULATE;
ColorArg1[1] = TEXTURE;
ColorArg2[1] = CURRENT;
AlphaOp[0] = DISABLE;
ColorOp[2] = DISABLE;
Texture[1] = (FogOfWar);
VertexShaderConstant[0] = <WorldViewProjection>;
VertexShaderConstant[27] = <FogScale>;
VertexShaderConstant[28] = <Ambient>;
VertexShaderConstant[30] = <LightDirection>;
VertexShaderConstant[31] = <ZBias>;
VertexShaderConstant[32] = <SunColor>;
VertexShader =
decl
{
stream 0;
float v0[3];
float v3[3];
float v6[2];
}
asm
{
vs_1_1
dcl_position v0
dcl_normal v3
dcl_texcoord0 v6
m4x4 oPos, v0, c0
mul r0, v0, c27
mov oT1.x, r0.x
mov oT1.y, r0.z
m4x4 r0, v0, c12
mov oT0, v6
dp3 r0, v3, c30
mov r1, c32
mad oD0, r0, r1, c28
};
PixelShader = NULL;
}
}
technique Technique1
{
pass Pass0
{
Texture[0] = (AlphaTexture);
ColorOp[0] = SELECTARG1;
ColorArg1[0] = DIFFUSE;
AlphaOp[0] = SELECTARG1;
AlphaArg1[0] = TEXTURE;
Texture[1] = (FogOfWar);
ColorOp[1] = MODULATE;
ColorArg1[1] = TEXTURE;
ColorArg2[1] = CURRENT;
AlphaOp[1] = DISABLE;
Texture[2] = (DiffuseTexture);
ColorOp[2] = MODULATE;
ColorArg1[2] = CURRENT;
ColorArg2[2] = TEXTURE;
ColorOp[3] = DISABLE;
VertexShaderConstant[0] = <WorldViewProjection>;
VertexShaderConstant[27] = <FogScale>;
VertexShaderConstant[30] = <LightDirection>;
VertexShaderConstant[31] = <ZBias>;
VertexShaderConstant[32] = <SunColor>;
VertexShaderConstant[28] = <Ambient>;
VertexShader =
decl
{
stream 0;
float v0[3];
float v3[3];
float v6[2];
float v8[2];
}
asm
{
vs_1_1
dcl_position v0
dcl_normal v3
dcl_texcoord0 v6
dcl_texcoord1 v8
m4x4 oPos, v0, c0
mul r0, v0, c27
mov oT1.x, r0.x
mov oT1.y, r0.z
m4x4 r0, v0, c12
mov oT2, v6
mov oT0, v8
dp3 r0, v3, c30
mov r1, c32
mad oD0, r0, r1, c28
};
PixelShader = NULL;
}
}